package com.bootdo.wx.enums;

public enum OrderStatus {

    //订单状态(0：砍价中，1：待支付，2：拼团中，3：待发货，4：待收货，5：退货中，6.退货成功，7：订单完成，8：订单取消，9：砍价失败，10：拼团失败，11：已补货）
    zero("砍价中"),one("待支付"),two("拼团中"),three("待发货"),four("待收货"),five("退货中"),six("退货成功"),seven("订单完成"),eight("订单取消"),nine("砍价失败"),ten("拼团失败");

    //以上是枚举的成员，必须先定义，而且使用分号结束
    private final String status;
    private OrderStatus(String status)
    {
        this.status=status;
    }

    public static String getStatus(int i)
    {
        String status = "未知";
        switch(i)
        {
            case 1:
                status = OrderStatus.one.status;
                break;
            case 2:
                status =OrderStatus.two.status;
                break;
            case 3:
                status = OrderStatus.three.status;
                break;
            case 4:
                status =OrderStatus.four.status;
                break;
            case 5:
                status =OrderStatus.five.status;
                break;
            case 6:
                status =OrderStatus.six.status;
                break;
            case 7:
                status =OrderStatus.seven.status;
                break;
            case 8:
                status =OrderStatus.eight.status;
                break;
            case 9:
                status =OrderStatus.nine.status;
                break;
            case 10:
                status =OrderStatus.ten.status;
                break;
                
            default:
                System.out.println("wrong number!");
        }
        return status;
    }
    public String getStatus()
    {
        return status;
    }
}
